package com.github.sbb.sherry.console.controller.engine.config;


import com.github.sbb.sherry.console.dto.PageList;
import com.github.sbb.sherry.console.service.engine.config.RuleParamConfigService;
import com.github.sbb.sherry.repository.entity.RuleParamConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("engine/config/ruleParam")
public class RuleParamConfigController {

  @Autowired
  private RuleParamConfigService ruleParamConfigService;

  @GetMapping("pageList")
  public PageList<RuleParamConfig> pageList(int currentPage, Integer pageSize) {
    return ruleParamConfigService.pageList(currentPage, pageSize);
  }

  @PostMapping("add")
  public void add(@RequestBody RuleParamConfig rulesParam) {
    ruleParamConfigService.add(rulesParam);
  }
}
